#include <iostream>
#include <ctime>
#include <cstdlib>
#include "RandomPlayer.h"

using namespace std;

RandomPlayer::RandomPlayer(string name) : Player(name) {
}

Cell* RandomPlayer::next() {
    vector<Cell*> cells = *(mBoard->findPutableCells(mColor));
    if (cells.empty()) {
        return NULL;
    }

    srand(time(NULL));
    return cells[rand() % cells.size()];
}
